<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-01-20
 * Time: 13:55
 */

namespace app\admin\model;


use think\Model;

class OrderModel extends Model
{
    // 确定链接表名
    protected $name = 'order';


    public function getOrderByWhere($where, $offset, $limit)
    {
        return $this->alias('user')->field( 'user.*,role_name')
            ->join('role rol', 'user.role_id = ' . 'rol.id')
            ->where($where)->limit($offset, $limit)->order('id desc')->select();
    }


    public function getAllOrder($where)
    {
        return $this->where($where)->count();
    }

}